/*
 * j4Win
 *  http://code.google.com/p/j4win/
 *
 * Copyright (C) 2006-2007 Felix Geyer, Moritz Laschinger
 *
 * This file is part of j4Win.
 *
 * j4Win is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * version 2 as published by the Free Software Foundation.
 *
 * j4Win is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 */

package j4win;

import java.awt.*;
import java.awt.event.*;

public class About extends Dialog {
	private static final long serialVersionUID = 1L;
	
	public static final String VERSION = "1.0 final"; //$NON-NLS-1$
	
	public About(Frame owner) {
		super(owner, Messages.getString(Messages.getString("About.about")), true); //$NON-NLS-1$
		 
		setResizable(false);
		setSize(450, 150);
		Point ol = owner.getLocation();
		setLocation(
			ol.x + (owner.getWidth()-getWidth())/2,
			ol.y + (owner.getHeight()-getHeight())/2
		);
		
		setLayout(new FlowLayout());
		
		add(new Label("   j4Win "+VERSION+"   ")); //$NON-NLS-1$
		add(new Label("Copyright (C) 2006-2007 Felix Geyer, Moritz Laschinger")); //$NON-NLS-1$
		add(new Label(Messages.getString("About.GPL")));
		Button ok = new Button(Messages.getString("About.ok")); //$NON-NLS-1$
		ok.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				setVisible(false);
			}
		});
		add(ok);
		
		addWindowListener(new WindowAdapter() {
			@Override
			public void windowClosing(WindowEvent e) {
				setVisible(false);
			}
		});
	}
}
